﻿using LindDDDSample.SeedWork;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace LindDDDSample.API.Data.AggregateModels.OrderAggregate
{
    public class Order
        : IAggregateRoot
    {
        public string OrderNo { get; set; }
        public Guid UserId { get; set; }
        public string UserName { get; set; }
        public OrderStatusEnum OrderStatus { get; set; }
        public decimal TotalFee { get; set; }
        public decimal UserPay { get; set; }
        public int TotalQuantity { get; set; }
        public Address Address { get; set; }
        public Shipping Shipping { get; set; }
        public IEnumerable<OrderDetail> OrderDetails { get; set; }

        public Order Created()
        {
            return this;
        }
        public void Payid()
        {
            OrderStatus = OrderStatusEnum.Payid;
        }
        public void Confirmed()
        {
            OrderStatus = OrderStatusEnum.Confirmed;
        }
        public void Shipped()
        {
            OrderStatus = OrderStatusEnum.Shipped;
        }
        public void Signed()
        {
            OrderStatus = OrderStatusEnum.Signed;
        }
    }
}
